﻿using System;
using System.Collections.Generic;
using System.Text;
using CTEM.Controllers.Global;
using CTEM.Controllers.Global;

namespace CTEM.Models
{
    public class CS_EstimateExpensesDTO
    {
        public long EstimateExpensesID { get; set; }
        public long ConstructionID { get; set; }
        public string ConstructionType { get; set; }
        public long MaterialEstimate { get; set; }
        public long MaterialExpenses { get; set; }
        public long WorkerEstimate { get; set; }
        public long WorkerExpenses { get; set; }
        public long MachineEstimate { get; set; }
        public long MachineExpenses { get; set; }
        public long TransportEstimate { get; set; }
        public long TransportExpenses { get; set; }
        public long OthersEstimate { get; set; }
        public long OthersExpenses { get; set; }
        public string CreatedBy { get; set; }
        public DateTime CreatedDate { get; set; }
        public string UpdatedBy { get; set; }
        public DateTime LastUpdated { get; set; }

        public long TotalEstimates { get; set; }
        public long TotalExpenses { get; set; }

        public HistoryLevel History { get; set; }

        public CS_EstimateExpensesDTO()
        {
            EstimateExpensesID = 0;
            ConstructionID = 0;
            ConstructionType = Constants.EMPTY_TEXT;
            MaterialEstimate = 0;
            MaterialExpenses = 0;
            WorkerEstimate = 0;
            WorkerExpenses = 0;
            MachineEstimate = 0;
            MachineExpenses = 0;
            TransportEstimate = 0;
            TransportExpenses = 0;
            OthersEstimate = 0;
            OthersExpenses = 0;
            CreatedBy = Global.CurrentUser.Username;
            CreatedDate = DateTime.Today;
            UpdatedBy = Global.CurrentUser.Username;
            LastUpdated = DateTime.Today;
            TotalEstimates = 0;
            TotalExpenses = 0;
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof(CS_EstimateExpensesDTO)) return false;
            return Equals((CS_EstimateExpensesDTO)obj);
        }

        public bool Equals(CS_EstimateExpensesDTO other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return Equals(other.EstimateExpensesID, EstimateExpensesID);
        }

        public static bool operator ==(CS_EstimateExpensesDTO left, CS_EstimateExpensesDTO right)
        {
            return Equals(left, right);
        }

        public static bool operator !=(CS_EstimateExpensesDTO left, CS_EstimateExpensesDTO right)
        {
            return !Equals(left, right);
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
    }
}
